package com.chonry.web2.bean;

import lombok.Data;

import java.io.Serializable;

@Data
public class Result <T> implements Serializable {
    private static final long serialVersionUID = -6517062678070151029L;
    private int code;
    private String codeInfo;
    private T data;

    public Result() {
    }
    public Result(T data) {
        this.code = 200;
        this.data = data;
    }
    public Result(String codeInfo, T data) {
        this.code = 200;
        this.codeInfo = codeInfo;
        this.data = data;
    }

    public Result(int code, String codeInfo, T data) {
        this.code = code;
        this.codeInfo = codeInfo;
        this.data = data;
    }

    public Result(int code, String codeInfo) {
        this.code = code;
        this.codeInfo = codeInfo;
    }
}
